package com.main.printing;

import java.util.StringTokenizer;

/**
 * @author Erik Stell
 * @version 1.0
 */
class WritersToolsDocument {
    private static final String DELIMITER = "\u0000";
    private String id;
    private final String text;

    /**
     * @param s
     */
    public WritersToolsDocument(String s) {
        StringTokenizer strtok = new StringTokenizer(s, DELIMITER);
        id = strtok.nextToken();
        if (strtok.hasMoreTokens())
            text = strtok.nextToken();
        else {
            text = id;
            id = "<unsigned message>";
        }
    }

    /**
     * @return
     */
    public String toString() {
        return id;
    }

    /**
     * @return
     */
    public String getText() {
        return text;
    }
}